<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:p="http://primefaces.org/ui">
    <ui:composition template="/template.xhtml">
        <ui:define name ="title">
            <h:outputText value="Welcome to BrainStretch"/>
        </ui:define>
        <ui:define name ="body">           
            <div id ="welcomeMsg">
                <h3>Welcome to BrainStretch</h3>                
            </div>
            <div id="recentQuizzes">
                <p:dataList value="#{homeController.recentQuizzes}" var ="quiz" styleClass="list">
                    <h:link outcome="takeQuiz" value ="#{quiz.title}">
                        <f:param name ="quizId" value ="#{quiz.id}"/>
                    </h:link>
                    <h:outputText value ="#{quiz.category}" class ="category secondary"/>
                    <h:outputText value ="#{quiz.creationDate}" class ="date secondary"/>
                    <h:link outcome="viewQuiz" value ="edit">
                        <f:param name ="quizId" value ="#{quiz.id}"/>
                    </h:link>
                </p:dataList>
            </div>
        </ui:define>
    </ui:composition>
</html>

